import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_map/flutter_baidu_mapapi_map.dart';
import 'package:flutter_general/pages/map/mapModel.dart';
import 'package:pkg_obz/export.dart';

/// Create： Zhang 2021/8/11
/// ERP:     ext.zhangjunfei
class MapPage extends PageStateful<MapModel> {
  MapPage() : super(pageModel: MapModel());

  @override
  Widget? rootView(BuildContext context) {
    return Stack(
      children: [
        Container(
          height: double.infinity,
          width: double.infinity,
          color: Colors.white,
          child: BMFMapWidget(
            onBMFMapCreated: (controller) {
              pageModel.onBMFMapCreated(controller);
            },
            mapOptions: pageModel.initMapOptions(),
          ),
        ),
        InkWell(
          splashColor: Colors.transparent,
          highlightColor: Colors.transparent,
          onTap: () => Navigator.pop(context),
          child: Container(
            width: 40,
            height: 40,
            margin: EdgeInsets.only(
              top: MediaQuery.of(context).padding.top + 10,
              left: 15,
            ),
            decoration: BoxDecoration(
              color: Color(0x66000000),
              borderRadius: BorderRadius.circular(90),
            ),
            child: Center(
              child: Icon(
                Icons.arrow_back,
                color: Color(0xffffffff),
                size: 20,
              ),
            ),
          ),
        )
      ],
    );
  }
}
